home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / dobbs / v17n03 / oopasm.exe / DLGMENU.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-07-11  |  1.6 KB  |  72 lines

  1.     .MODEL    SMALL
  2.  
  3.     INCLUDE    equates.inc
  4.     INCLUDE    instance.inc
  5.     INCLUDE    messages.inc
  6.     INCLUDE    objects.inc
  7.  
  8. IF1
  9.     INCLUDE    macros.mac
  10.     INCLUDE    objects.mac
  11. ENDIF
  12.  
  13.     EXTRN    HorzMenu:WORD
  14.     EXTRN    Self:WORD
  15.  
  16.     .CODE
  17.  
  18. COMMENT    %
  19. ==============================================================================
  20. Sets DlgMenu's instance variables with values handed down from the master.
  21.  
  22. =============================================================================%
  23. initDlgMenuVars    PROC    NEAR
  24.     push        Self
  25.     getInst$    ch,Row2,MasterObj    ;Get upper row from master
  26.     getInst        cl,Col1            ;Get left column
  27.     getInst        di,MenuTbl        ;Get menu tbl ptr
  28.     getInst        ax,MenuPtr        ;Get menu ptr
  29.     getInst        bx,DispTbl        ;Get dispatch tbl ptr
  30.     getInst        dl,Color        ;Get color
  31.  
  32.     sub        ch,RowOffset        ;Subtract row offset
  33.     add        cl,ColOffset        ;Add in column offset
  34.  
  35.     setInst        MenuPtr,ax,DlgMenu    ;Set menu ptr
  36.     setInst        MenuTbl,di        ;Set menu tbl ptr
  37.     setInst        DispTbl,bx        ;Set dispatch tbl ptr
  38.     setInst        Row1,ch            ;Set upper row
  39.     setInst        Row2,ch            ;Set lower row
  40.     setInst        Col1,cl            ;Set left column
  41.     setInst        Col2,cl            ;Set right column
  42.     setInst        Color,dl        ;Set color
  43.     pop        Self
  44.     ret
  45. initDlgMenuVars    ENDP
  46.  
  47.  
  48.  
  49.     .DATA
  50.  
  51. defMsg    DlgMenu,\
  52.     Refresh,\
  53.     <initDlgMenuVars,,>
  54.  
  55. defObj    DlgMenu,\
  56.     <HorzMenu>,\
  57.     <Row1,1,13,\
  58.     Col1,1,17,\
  59.     Row2,1,13,\
  60.     Col2,1,63,\
  61.     Color,1,Nil,\
  62.     Unused,1,Nil,\
  63.     TxtPtr,2,Nil,\
  64.     InxPtr,2,0,\
  65.     MasterObj,2,Nil,\
  66.     DispTbl,2,Nil,\
  67.     MenuPtr,2,Nil,\
  68.     MenuTbl,2,Nil>,\
  69.     <Refresh,Read,Next,Prev,Select,Clear,Hilite,Flash>
  70.  
  71.     END
  72.